﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Mediator.Framework.Runtime.Communication.InProcess
{
    /// <summary>
    /// Inprocess communication protocol.
    /// Singlettone pattern used.
    /// </summary>
    public sealed class Protocol:IProtocol
    {
        #region Private fields
        private static Protocol _instance = null;
        private static readonly Object SyncRoot = new object();
        #endregion
        #region .Ctor
        private Protocol()
        {
            
        }
        #endregion
        #region Public members
        public static Protocol Instance
        {
            get
            {
                if(_instance == null)
                {
                    lock (SyncRoot)
                    {
                        if(_instance == null)
                        {
                            _instance = new Protocol();
                        }
                    }
                }
                return _instance;
            }
        }
        #endregion

        #region Implementation of IProtocol

        public IListner Listen(IListnerProcessor listnerProcessor)
        {
            throw new NotImplementedException();
        }

        public IListner Listen(IListnerProcessor listnerProcessor, IEndpoint localEndpoint)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
